package com.gpay.erp.services.system.impl;

import java.util.List;
import javax.annotation.Resource;
import com.gpay.erp.core.dao.BaseDao;
import com.gpay.erp.core.dao.page.PagerModel;
import com.gpay.erp.core.system.bean.SysUser;
import com.gpay.erp.services.system.LoginInteface;
import org.springframework.stereotype.Service;

/**
 * 用户业务逻辑实现类
 * 
 * @author lg
 * 
 */
@Service
public class LoginService implements LoginInteface {
	@Resource
	private BaseDao dao;

	public void setDao(BaseDao dao) {
		this.dao = dao;
	}

	// 用户登录
	public SysUser login(SysUser sysUser) {
		if (sysUser.getUserName() != null && sysUser.getUserPassword() != null) {
			return (SysUser) dao.selectOne("sysUser.selectUserNameAndPwd",sysUser);
		} else {
			return null;
		}
	}

	// 密码修改
	public int updatePwd(SysUser sysUser) {
		return dao.update("sysUser.updatePwd", sysUser);
	}

	// 权限资源查询
	public List menuSelect(SysUser sysUser) {
		return dao.selectList("sysUser.queryATree", sysUser);
	}

	public int insert(PagerModel e) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int delete(PagerModel e) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int deletes(String[] ids) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int update(PagerModel e) {
		// TODO Auto-generated method stub
		return 0;
	}

	public PagerModel selectOne(PagerModel e) {
		// TODO Auto-generated method stub
		return null;
	}

	public PagerModel selectById(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	public List selectList(PagerModel e) {
		// TODO Auto-generated method stub
		return null;
	}

	public PagerModel selectPageList(PagerModel e) {
		// TODO Auto-generated method stub
		return null;
	}

}
